import request from '@/utils/request'

// 查询休假记录列表
export function listLeave(query) {
  return request({
    url: '/module/cjl/leave/list',
    method: 'get',
    params: query
  })
}

// 查询休假记录详细
export function getLeave(id) {
  return request({
    url: '/module/cjl/leave/' + id,
    method: 'get'
  })
}
// 查询部门待审获取电话号
export function getPhone(id) {
  return request({
    url: '/module/cjl/leave/searchAudit/'+ id,
    method: 'get'
  })
}

// 查询局长待审获取电话号
export function getDirector() {
  return request({
    url: '/module/cjl/leave/director',
    method: 'get'
  })
}

// 查询政委待审获取电话号
export function getCommissor() {
  return request({
    url: '/module/cjl/leave/commissor',
    method: 'get'
  })
}

// 新增休假记录
export function addLeave(data) {
  return request({
    url: '/module/cjl/leave',
    method: 'post',
    data: data
  })
}

// 修改休假记录
export function updateLeave(data) {
  return request({
    url: '/module/cjl/leave/edit',
    method:"put",
    data: data
  })
}
// 销假记录
export function backLeave(data) {
  return request({
    url: '/module/cjl/leave/back',
    method:"put",
    data: data
  })
}
// 部门审核休假记录
export function viewLeave(data) {
  return request({
    url: '/module/cjl/leave/view',
    method:"put",
    data: data
  })
}

// 局长审核休假记录
export function chiefLeave(data) {
  return request({
    url: '/module/cjl/leave/chief',
    method:"put",
    data: data
  })
}
// 政委审核休假记录
export function gaottLeave(data) {
  return request({
    url: '/module/cjl/leave/gaott',
    method:"put",
    data: data
  })
}
// 删除休假记录
export function delLeave(id) {
  return request({
    url: '/module/cjl/leave/' + id,
    method: 'delete'
  })
}
